#include <bits/stdc++.h>
using namespace std;
const int maxn=114514;
int maxr=-0x3f3f3f3f;
int n,ans;
bool r2;
int r[maxn],a[maxn];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    r2=true;
    for(int i=1,x;i<=n;i++)
    {
        scanf("%d",&x);
        maxr=max(maxr,x);
        if(x>2) r2=false;
        r[x]++;
        a[i]=x;
    }
    if(r2)
    {
        for(int i=1;i<maxr;i++)
        {
            int pos=i;
            while(1)
            {
                pos++;
                if(r[pos])
                {
                    r[i]-=min(r[i],r[pos]);
                    break;
                }
                if(pos==maxr) break;
            }
        }
        for(int i=1;i<=maxr;i++) ans+=r[i];
        printf("%d\n",ans);
    }
    else
    {
        sort(a+1,a+n+1);
        for(int i=2;i<=n;i++)
        {
            if(a[i]!=a[1])
            {
                for(int j=1;j<=i;j++)
                {
                    if(a[j]!=-1)
                    {
                        ans++;
                        a[j]=-1;
                        break;
                    }
                }
            }
        }
        ans=n-ans;
        printf("%d\n",ans);
    }
    return 0;
}
